﻿using Microsoft.Extensions.DependencyInjection;
using PLCS.App.OrderTask.ViewModels.HisInstruction;
using PLCS.App.OrderTask.ViewModels.HisOrder;
using PLCS.App.OrderTask.ViewModels.HisTask;
using PLCS.App.OrderTask.ViewModels.Instruction;
using PLCS.App.OrderTask.ViewModels.Order;
using PLCS.App.OrderTask.ViewModels.TaskModule;
using PLCS.App.OrderTask.Views.HisInstruction;
using PLCS.App.OrderTask.Views.HisOrder;
using PLCS.App.OrderTask.Views.HisTask;
using PLCS.App.OrderTask.Views.Instruction;
using PLCS.App.OrderTask.Views.Order;
using PLCS.App.OrderTask.Views.TaskModule;
using PLCS.Client.IService.LogManager;
using PLCS.Client.Service.LogManager;
using PLCS.Client.Service.OrderTask;
using Prism.Ioc;
using Prism.Modularity;
using Volo.Abp.AutoMapper;
using Volo.Abp.Modularity;

namespace PLCS.App.OrderTask;

[DependsOn(typeof(AbpAutoMapperModule))]
public class OrderTaskModule : AbpModule, IModule
{
    public void OnInitialized(IContainerProvider containerProvider)
    {
    }

    public void RegisterTypes(IContainerRegistry containerRegistry)
    {
        containerRegistry.RegisterForNavigation<OrderView, OrderViewModel>();
        containerRegistry.RegisterForNavigation<TaskView, TaskViewModel>();
        containerRegistry.RegisterForNavigation<TaskDetailView, TaskDetailViewModel>();
        containerRegistry.RegisterForNavigation<HisTaskView, HisTaskViewModel>();
        containerRegistry.RegisterForNavigation<HisOrderView, HisOrderViewModel>();
        containerRegistry.RegisterForNavigation<InstructionView, InstructionViewModel>();
        containerRegistry.RegisterForNavigation<InstructionDetailView, InstructionDetailViewModel>();
        containerRegistry.RegisterForNavigation<HisInstructionView, HisInstructionViewModel>();

        containerRegistry.RegisterForNavigation<OrderDetailView, OrderDetailViewModel>();
    }

    public override void ConfigureServices(ServiceConfigurationContext context)
    {
        context.Services.AddAutoMapperObjectMapper<OrderTaskModule>();

        Configure<AbpAutoMapperOptions>(options =>
        {
            options.AddMaps<OrderTaskModule>();
        });
    }
}